package com.hanamaki.basic.struct;

import java.util.Scanner;

public class For2 {
    public static void main(String[] args) {

        double sum = 0;

        for (int j = 1/*初始值*/; j <= 5 /*循环条件*/; j++ /*循环迭代*/) {
            /*循环体*/
            System.out.println("请输入第" + j + "个课程的成绩");
            Scanner scanner = new Scanner(System.in);
            sum += scanner.nextDouble();
        }
//            计算平均分
        double avg = 0;
        avg = sum / 5;
        System.out.println("平均分；" + avg);

//        死循环
        for (; ; ) {
            System.out.println("i");
        }


    }

}
